Skip to content

Preserve custom note type CSS#34

Merged
RisingOrange merged 3 commits intomasterfrom
feat/preserve-css-below-ankihub-end-comment
Jan 29, 2025
Merged

Preserve custom note type CSS#34
RisingOrange merged 3 commits intomasterfrom
feat/preserve-css-below-ankihub-end-comment

Conversation

@RisingOrange
Copy link
Collaborator

@RisingOrange RisingOrange commented Jan 28, 2025

We are preserving HTML below the ankihub end comment on the note type card templates, which allows users to add modifications to them.

However, we don't have that for note type styling.

This task makes it so that content below a special ankihub end comment is preserved for the note type styling.

It also fixes an issue where more and more white space is added to the note type templates.

Related AnkiHub add-on PR: AnkiHubSoftware/ankihub_addon#1088

Related issues

AnKing-VIP/AnKing-Note-Types#219 (comment)

How to reproduce

  • Start Anki, go to Tools -> Note Types
  • Choose an AnkiHub note type, click on Cards
  • Edit the version on top of the card template
    • This will allow us to perform a note type update
  • Open the AnKing Note Types dialog (AnKing -> AnKing Note Types)
  • Click the Update notetypes button and confirm
  • Open the card template of the note type again, switch to the Styling tab
  • Scroll to the end of the Styling content
  • The AnkiHub end comment should be at the end
  • Put some text above the end comment and some text below the end comment
  • Edit the version on top of the card template and update note types again
  • Check the Styling tab of the note type
    • The text you added above the comment shouldn't be there
    • The text you added below the comment should be still there

It's the same behavior for the other tabs besides Styling (Front Template and Back Template), which we already had previously

@RisingOrange RisingOrange merged commit 3eed529 into master Jan 29, 2025
1 check passed
@RisingOrange RisingOrange deleted the feat/preserve-css-below-ankihub-end-comment branch January 29, 2025 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants